
<div class="am-u-sm-12 widget main-w" >
	<ol class="am-breadcrumb">
		<li><a href="{:url('/admin/index')}">首页</a></li>
		<li><a href="{:url('/admin/car/index')}">业务管理</a></li>
		<li class="am-active">北斗接入</li>
	</ol>
	<div class="am-u-sm-12">
		<form class="am-form-inline tpl-form-border-form" action="" method="get">
			<div class="am-u-sm-12">
				<div class="am-u-sm-2">
					<div class="am-form-group am-u-sm-12 cl-p">
						<input type="text" class="tpl-form-input" name="number" placeholder="请输入车牌号" value="{$Think.get.number}">
					</div>
				</div>
				<div class="am-u-sm-2 cl-p">
					
					<div class="am-form-group am-u-sm-12 cl-p">
						<div class="am-u-sm-12 cl-p po_relative">
							<input type="hidden" class="car_rental_id" name="car_rental_id" value="{$Think.get.car_rental_id}" />
							<input type="text" class="am-form-field tpl-form-no-bg  car_rental" name="car_rental_name"  value="{$Think.get.car_rental_name}" data-check='require' data-msg="请选择所属公司/单位" placeholder="点击选择公司/单位" readonly="">
							<span class="input-group-addon close-input"><i class="am-icon-close"></i></span>  
						</div>
					</div>
				</div>
				<div class="am-u-sm-2">
					<div class="am-form-group am-u-sm-12 cl-p">
						<select name="car_state" class="car_state" data-am-selected="{btnWidth:'100%', btnSize: 'sm'}">
							<option {$Think.get.car_state?:selected} value="0">车辆状态-全部</option>
							<option {$Think.get.car_state==1?selected: ""} value="1">在线-停止</option>
							<option {$Think.get.car_state==2?selected: ""} value="2">在线-行驶</option>
							<option {$Think.get.car_state==3?selected: ""} value="3">离线</option>
							<option {$Think.get.car_state==4?selected: ""} value="4">终端没电</option>
						</select>
					</div>
				</div>
				<div class="am-u-sm-6">
					<button type="submit" class="am-btn am-btn-sm am-btn-primary am-radius">查询<i class="am-icon-search"></i></button>
					<button type='button' style="display: none;" class="am-btn am-btn-sm am-radius am-btn-primary daochu">导出路径</button>
					<button type='button' class="am-btn am-btn-sm am-radius am-btn-primary dayin">打印</button>
				</div>
			</div>
		</form>
	</div>
	<div class="am-u-sm-12" style="position: relative;height: 100%;page-break-before:auto;page-break-after: always;">
		<div id="map" data-map="1" style="width: 100%;min-height: 500px;margin-top:20px ;" ></div>
		<div class="toolshow" style="text-align: center;">
			<i class="am-icon-bars" style="line-height: 34px;"></i>
		</div>
		<div id="panel"></div>
		<div id="tip">
		    省：<select id='province' style="width:100px" onchange='search(this)'></select>
		    市：<select id='city' style="width:100px" onchange='search(this)'></select>
		    区：<select id='district' style="width:100px" onchange='search(this)'></select>
		    街道：<select id='street' style="width:100px" onchange= 'setCenter(this)'></select>
		</div>
		<div id="pickerBox" style="display: none;">
	        <input id="pickerInput" placeholder="输入关键字选取地点" />
	        <div id="poiInfo"></div>
	    </div>
		<div class='button-group' style="background-color: #0d9bf2;color:#fff;display: none;">
			
				<input type="checkbox" id="real_time"/>实时路况
		
		
				<input type="checkbox" id="poi"/>关键字搜索
			
		
				<input type="checkbox" id="admarea"/>行政区域查看
			
				<input type="checkbox" id="overview"/>显示鹰眼
	
		    	<input class='scale' type="checkbox" />比例尺
		    
		    	<input type="checkbox" id="shrink"/>拉框缩小
		    
		    	<input type="checkbox" id="magnify"/>拉框放大
		    
		   	 	<input type="checkbox" id="distance"/>距离量测
		    
		    	<input type="checkbox" id="toolbar" />工具条
		    
			
		  
		    	<input type="checkbox" id="toolbarDirection" disabled />工具条方向盘
		    
		    	<input type="checkbox" id="toolbarRuler" disabled />工具条标尺
		    
			
			 
		   
		    <!--<input type="checkbox" id="overviewOpen" disabled />展开鹰眼-->
		    
		</div>
		<div class="am-u-sm-12  po_absolute anomaly" style="top: 0px;left: 0px;margin-top:20px ;box-sizing: border-box;">
			<div class="am-u-sm-12 cl-p">
				<div class="str3 str_wrap">
					<ul style="font-size: 15px;line-height: 30px;height: 30px;">
					
					</ul>
				</div>
			</div>
			
		</div>
		
		<div class="am-u-sm-3 carlist" >
			<div class="nowdata " style="padding: 10px;">车辆列表<small class="retime"></small><small class="carnum"></small> </div>
			<div style="height: 80%;overflow: hidden;" class="carlist-list">
				<ul></ul>
			</div>
		</div>

		<div class="am-u-sm-6 car_date" style="margin-bottom: 5px;">
			<div class="am-u-sm-10" >
				<div class="am-u-sm-5 cl-p">
					<input style="width: 100%;" class='stardate' type="datetime-local" />
					<input style="width: 100%;" type="hidden" class='date_number'  />
				</div>
				<div class="am-u-sm-1 cl-p" style='text-align: center;'>-</div>
				<div class="am-u-sm-5 cl-p">
					<input style="width: 100%;" class='enddate' type="datetime-local" />
				</div>
				<div class="am-u-sm-1 cl-p" style='text-align: center;'></div>
			</div>
			<div class="am-u-sm-2 cl-p" >
				<button class="am-btn am-btn-sm am-radius am-btn-primary">查询</button>
				

			</div>
		</div>
		<div class="am-u-sm-3 orderlist" >
			<div style="padding: 10px;">
				<span class="ordertitle">订单</span>
				<span class="am-fr">
					<button type="button" class="am-btn am-btn-xs am-btn-secondary am-round backcar">选择车辆</button>
				</span>
			</div>
			<div style="height: 83%;overflow: hidden;border-bottom: 1px solid #ccc;"  class="orderlist-list">
				<ul >
				</ul>
			</div>
			<div class="am-fr am-u-sm-12" >
				<span class="next am-fr" style="font-size: 12px;cursor: pointer;">下一页</span>
				<span class="page am-fr" style="font-size: 12px;">1</span>
				<span class="previous am-fr" style="font-size: 12px;cursor: pointer;">上一页</span>
			</div>
		</div>
		
	</div>
</div>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.2&key={:config('base.mapkey')}&plugin=AMap.Driving,AMap.Scale,AMap.OverView,AMap.ToolBar,AMap.MouseTool,AMap.DistrictSearch,AMap.MarkerClusterer"></script>
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="{$static_dir}/assets/js/jquery.liMarquee.js"></script>
<script>
	//滚动信息

	$.ajax({
		type:"post",
		url:"{:url('adminapi/order/getExceptionOrder')}",
		success:function(res){
			ajaxalarm(1)
			console.log(res)
			if(res.code==1){
				var strbody="";
				var wid=0;
				for(var i=0 ;i<res.data.length;i++){
					if(res.data[i].exception_type==1){
						dispresult='司机出发地偏离,订单轨迹偏移'
					}else if(res.data[i].exception_type==2){
						dispresult=' 司机目的地偏离,订单轨迹偏移'
					}else if(res.data[i].exception_type==4){
						dispresult='订单超时,订单轨迹偏移'
					}else if(res.data[i].exception_type==8){
//						dispresult='订单超里程'
					}else if(res.data[i].exception_type==3){
						dispresult='司机出发地偏离,司机目的地偏离,订单轨迹偏移'
					}else if(res.data[i].exception_type==5){
						dispresult='司机出发地偏离,订单超时,订单轨迹偏移'
					}else if(res.data[i].exception_type==9){
						dispresult='司机出发地偏离,订单轨迹偏移'
					}else if(res.data[i].exception_type==6){
						dispresult='司机目的地偏离,订单超时,订单轨迹偏移'
					}else if(res.data[i].exception_type==10){
						dispresult='司机目的地偏离,订单轨迹偏移'
					}else if(res.data[i].exception_type==12){
						dispresult='订单超时,订单轨迹偏移'
					}else if(res.data[i].exception_type==7){
						dispresult='司机出发地偏离,司机目的地偏离,订单超时'
					}else if(res.data[i].exception_type==11){
						dispresult='司机出发地偏离,司机目的地偏离,订单轨迹偏移'
					}else if(res.data[i].exception_type==13){
						dispresult='司机出发地偏离,订单超时,订单轨迹偏移'
					}else if(res.data[i].exception_type==14){
						dispresult='司机目的地偏离,订单超时,订单轨迹偏移'
					}else if(res.data[i].exception_type==15){
						dispresult='司机出发地偏离,司机目的地偏离,订单超时,订单轨迹偏移'
					}else{
						dispresult='订单轨迹偏移'
					}
					if(res.data[i].has_solve==1){}else{
						strbody+=`<li style="float: left;padding-left:50px ;color:red">订单${res.data[i].order_no}(${dispresult})</li>`
					}
				}
				console.log(res)
				$('.str3 ul').html(`${strbody}`)
				for(var j=0;j<$('.str3 ul li').length;j++){
					var num=$('.str3 ul li').eq(j).width()-0
					wid+=num
				}
				wid += $('.str3 ul li').length * 80;

				$('.str3 ul').css('width',wid)
				
			}

			$('.str3').on('click', function() {
				choosecar("{:url('alarm',['op'=>'search'])}", '异常');
			})
			alarint=setTimeout(function() {
				ajaxalarm(2)		
			},10000)
		}

	});
	function ajaxalarm(type){
		var panduan=0;
		$.ajax({
		type:"post",
		url:"{:url('adminapi/order/getExceptionOrder')}",
		success:function(res){
			var alarmconut=0;
			
			for(var ii2=0 ;ii2<res.data.length;ii2++){
				if(res.data[ii2].has_solve==9){
					panduan=1
				}
			}
			console.log(panduan)
			if(panduan==1){
				
					var alarm_hint=layer.open({
						    type: 1,
						    title:false,
						    id: 'alarmprop',
				       		offset: 'rb',
						    skin: 'layui-layer-rim', //加上边框
						    area: ['300px', '120px'],
						    shade: 0  ,//不显示遮罩//宽高
						    content: `<div class='am-u-sm-12' style="padding:20px">
						  				<div class='am-u-sm-12' style='text-align: center;'>有异常订单未处理</div>
						  				<div class='am-u-sm-12' style='text-align: center;'>
						  				<button class="am-btn am-btn-sm am-radius am-btn-primary alarm_dispose">处理</button>
						  				<button class="am-btn am-btn-sm am-radius am-btn-primary prop_close">取消</button>
						  				</div>
						  			</div>`,
						  	success:function(){
						  		$('.alarm_dispose').on('click',function(){
						  			
						  			choosecar("{:url('alarm',['op'=>'search'])}", '异常');
						  			layer.close(alarm_hint)
						  			
						  		});
						  		$('.prop_close').on('click',function(){
						  			layer.close(alarm_hint)
						  		})
						  	}
						});
				}else{
					
				}
			
			alarint=setTimeout(function() {
				ajaxalarm(2)		
			},10000)
		}
		})
	}
</script>
<!--<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>-->
<!--<script src="{$static_dir}/assets/js/maporigin.js"></script>-->
<script src="{$static_dir}/assets/js/mapsearch.js"></script>
<script src="{$static_dir}/assets/js/maptool.js"></script>


